using System;
using System.Runtime.InteropServices;
namespace APP.HELPER.Utils.Net
{
    [Flags]
    internal enum ConnectionState
    {
        InternetConnectionModem = 1,
        InternetConnectionLan = 2,
        InternetConnectionProxy = 4,
        InternetRasInstalled = 16,
        InternetConnectionOffline = 32,
        InternetConnectionConfigured = 64
    }
	public class Internet
	{
		[DllImport("wininet.dll", CharSet = CharSet.Auto)]
		private static extern bool InternetGetConnectedState(ref ConnectionState lpdwFlags, int dwReserved);
		public static bool IsConnectedToInternet()
		{
			ConnectionState connectionState = (ConnectionState)0;
			return Internet.InternetGetConnectedState(ref connectionState, 0);
		}
	}
}
